package org.huawei260.TiKu.ODsuanfa;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: 3198 【贪心】2024D-环中最长子串
 * @version: 1.0
 */
import java.util.Scanner;
public class D_2024D_3198__贪心_环中最长子串 {

//	public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			System.out.println(getResult(sc.nextLine()));
		}

		public static int getResult(String s) {
			int n = s.length();

			// s中'o'的个数
			int zeroCount = 0;

			for (int i = 0; i < n; i++) {
				if (s.charAt(i) == 'o') zeroCount++;
			}

			if (zeroCount % 2 == 0) {
				return n;
			} else {
				return n - 1;
			}
		}
	}